<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE html>
<html>
<head>
    <%@include file="../../../resources/inc/head.jsp" %>
    <style>
        .layui-elem-quote {
            padding: 4px 15px;
        }

        .tableBlock {
            margin: 20px auto;
        }

        .tableBlock table {
            width: 100%;
            text-align: center;
            border-collapse: collapse;
            line-height: 36px;
        }

        .tableBlock table th {
            text-align: right;
            padding-right: 12px;
            font-weight: normal;
            color: #1a1a1a;
            white-space: nowrap;
        }

        .tableBlock table td, .tableBlock table th {
            border: 1px solid #e6e6e6;
            font-size: 14px;
        }

        .layui-input, .layui-select, .layui-textarea {
            border: none;
        }

        .upload-div li {
            display: inline-block;
            width: 120px;
            margin-right: 20px;
            vertical-align: top;
            text-align: center;
        }

        .upload-div li .upload-item {
            width: 100%;
            height: 180px;
            text-align: center;
            border: 1px solid #e6e6e6;
            position: relative;
        }

        .layui-input-inline {
            overflow: hidden;
            height: 180px;
            width: 120px
        }

        .layui-upload-drag {
            border: none;
        }
    </style>
</head>

<div class="layui-fluid" style="min-width: 1150px">
    <expect-x:tip tipMessage="标识“*”的选项为必填项，其余为选填项。;请按提示信息填写每一个字段"/>

    <div class="layui-card">

        <div class="layui-card-body">
            <c:if test="${!sessionScope.oauthData.isAuth && sessionScope.oauthData.status==0}">
                资料认证中...
            </c:if>
            <c:if test="${!sessionScope.oauthData.isAuth && sessionScope.oauthData.status==3}">
                资料认证失败,失败信息如下:【<span style="color: red">${sessionScope.oauthData.message}</span>】
            </c:if>
            <c:if test="${!sessionScope.oauthData.isAuth && sessionScope.oauthData.status!=0}">
                <form class="layui-form" action="">
                    <div class="layui-form-item" style="text-align: right">
                        <div class="layui-input-block">
                            <c:if test="${!sessionScope.oauthData.isAuth}">
                                <c:if test="${sessionScope.oauthData.status==-1}">
                                    <button class="layui-btn" lay-submit lay-filter="formDemo">提交认证</button>
                                </c:if>
                                <c:if test="${sessionScope.oauthData.status==3}">
                                    <button class="layui-btn" lay-submit lay-filter="formDemo">更新认证</button>
                                </c:if>
                            </c:if>
                        </div>
                    </div>
                    <div class="layui-tab" style="margin-top: 20px">
                        <ul class="layui-tab-title">
                            <li  class="layui-this" >1.基础信息</li>
                            <li>2.法人信息</li>
                            <li>3.企业结算信息</li>
                            <li>4.负责人信息</li>
                            <li>5.门店信息</li>
                            <li>6.补充信息</li>
                        </ul>
                        <div class="layui-tab-content">
                            <div class="layui-tab-item    layui-show">

                                <div class="tableBlock">
                                    <blockquote class="layui-elem-quote">工商信息</blockquote>
                                    <table>
                                        <tbody>
                                        <tr>
                                            <th>业务申请编码：</th>
                                            <td colspan="5">
                                                <input type="text" id="businessCode" disabled name="businessCode" value="${merchantOauth.businessCode}" placeholder="业务申请编码" autocomplete="off"  class="layui-input">
                                            </td>
                                        </tr>
                                        <tr>
                                            <th><span class="require-field">*</span>工商注册名称：</th>
                                            <td >
                                                <input type="hidden" name="id" value="${merchantOauth.id}">
                                                <input type="text" name="registeredName" value="${merchantOauth.registeredName}"
                                                       placeholder="工商注册名称" autocomplete="off" class="layui-input" lay-verify="required"   >
                                            </td>
                                            <th><span class="require-field">*</span>主体类型：</th>
                                            <td>
                                                <select name="organizationType">
                                                    <option value="2" ${merchantOauth.organizationType=='2'?'selected':''}>企业
                                                    </option>
                                                    <option value="3" ${merchantOauth.organizationType=='3'?'selected':''}>党政
                                                    </option>
                                                    <option value="4" ${merchantOauth.organizationType=='4'?'selected':''}>个体工商户
                                                    </option>
                                                    <option value="1708" ${merchantOauth.organizationType=='1708'?'selected':''}> 其他组织 </option>
                                                </select>
                                            </td>
                                            <th><span class="require-field">*</span>营业执照类型：</th>
                                            <td>
                                                <select name="businessLicenceType">
                                                    <option value="1762" ${merchantOauth.businessLicenceType=='1762'?'selected':''}>已三证合一 </option>
                                                    <option value="1763" ${merchantOauth.businessLicenceType=='1763'?'selected':''}>未三证合一</option>
                                                </select>
                                            </td>
                                        </tr>
                                        <tr>

                                            <th><span class="require-field">*</span>营业执照注册号：</th>
                                            <td>
                                                <input type="text" name="businessLicenseRegistrationName" lay-verify="required"
                                                       value="${merchantOauth.businessLicenseRegistrationName}"
                                                       placeholder="营业执照注册号" autocomplete="off" class="layui-input">
                                            </td>
                                            <th><span class="require-field">*</span>组织机构代码号：</th>
                                            <td>
                                                <input type="text" name="organizationCodeNumber" lay-verify="required"
                                                       value="${merchantOauth.organizationCodeNumber}" placeholder="组织机构代码号"
                                                       autocomplete="off" class="layui-input">
                                            </td>
                                            <th>税务登记号：</th>
                                            <td>
                                                <input type="text" name="taxRegistrationNumber"  value="${merchantOauth.taxRegistrationNumber}"   placeholder="税务登记号" autocomplete="off" class="layui-input">
                                            </td>

                                        </tr>
                                        <tr>
                                            <th><span class="require-field">*</span>营业执照有效期：</th>
                                            <td colspan="2">
                                                <c:if test="${fn:length(fn:split(merchantOauth.validityOfBusinessLicense,'|' ))==2}">
                                                    <input type="text" id="business_license_validity" lay-verify="required"
                                                           name="validityOfBusinessLicense"
                                                           value="${fn:split(merchantOauth.validityOfBusinessLicense,'|' )[0]}"
                                                           placeholder="营业执照有效期" autocomplete="off" class="layui-input"
                                                           style="width: 50%;float: left">

                                                    <input type="checkbox" id="validityOfBusinessLicense" name="box1"
                                                           lay-filter="validityOfBusinessLicense"
                                                           title="永久有效" checked
                                                           lay-skin="primary" style="float: left">
                                                </c:if>
                                                <c:if test="${fn:length(fn:split(merchantOauth.validityOfBusinessLicense,'|' ))==1}">
                                                    <input type="text" id="business_license_validity" lay-verify="required"
                                                           name="validityOfBusinessLicense"
                                                           value="${merchantOauth.validityOfBusinessLicense}"
                                                           placeholder="营业执照有效期" autocomplete="off" class="layui-input"
                                                           style="width: 50%;float: left">

                                                    <input type="checkbox" id="validityOfBusinessLicense" name="box1"
                                                           lay-filter="validityOfBusinessLicense"
                                                           title="永久有效"${merchantOauth.validityOfBusinessLicense=='0'?'checked':''}
                                                           lay-skin="primary" style="float: left">
                                                </c:if>

                                            </td>
                                            <th><span class="require-field">*</span>组织机构代码期限：</th>
                                            <td colspan="2">

                                                <c:if test="${fn:length(fn:split(merchantOauth.organizationTime,'|' ))==2}">
                                                    <input type="text" id="organization_time" lay-verify="required"
                                                           name="organizationTime"
                                                           value="${fn:split(merchantOauth.organizationTime,'|' )[0]}"
                                                           placeholder="组织机构代码期限" autocomplete="off" class="layui-input"
                                                           style="width: 50%;float: left">
                                                    <input type="checkbox" id="organizationTimeLicense" name="box3"
                                                           lay-filter="organizationTimeLicense"
                                                           title="永久有效" checked
                                                           lay-skin="primary" style="width: 50%;float: left">
                                                </c:if>
                                                <c:if test="${fn:length(fn:split(merchantOauth.organizationTime,'|' ))==1}">
                                                    <input type="text" id="organization_time" lay-verify="required"
                                                           name="organizationTime"
                                                           value="${merchantOauth.organizationTime}"
                                                           placeholder="组织机构代码期限" autocomplete="off" class="layui-input"
                                                           style="width: 50%;float: left">
                                                    <input type="checkbox" id="organizationTimeLicense" name="box3"
                                                           lay-filter="organizationTimeLicense"
                                                           title="永久有效"
                                                           lay-skin="primary" style="width: 50%;float: left">
                                                </c:if>


                                            </td>
                                        </tr>
                                        <tr>

                                            <th><span class="require-field">*</span>注册地址：</th>
                                            <td colspan="5">
                                                <input type="text" name="registeredAddress" lay-verify="required"
                                                       value="${merchantOauth.registeredAddress}" placeholder="注册地址"
                                                       autocomplete="off" class="layui-input">
                                            </td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                                <div class="tableBlock">
                                    <blockquote class="layui-elem-quote">企业证件信息</blockquote>
                                    <div class="upload-wrapper upload-div "  >
                                        <ul>
                                            <li>
                                                <div class="upload-item">
                                                    <div class="layui-input-inline">
                                                        <expect-x:webUploader pickerId="businessLicense" required="true"
                                                                              fileList="${merchantOauth.businessLicense}"
                                                                              fileCatalog="${sessionScope.merchantNo}"
                                                                              isLocal="false" width="120" height="180"/>
                                                    </div>
                                                </div>
                                                <span><span class="require-field">*</span>营业执照(正本)</span>
                                            </li>
                                            <li>
                                                <div class="upload-item">
                                                    <div class="layui-input-inline">
                                                        <expect-x:webUploader required="false" pickerId="taxRegistrationCertificate"
                                                                              fileCatalog="${sessionScope.merchantNo}"
                                                                              isLocal="false"
                                                                              fileList="${merchantOauth.taxRegistrationCertificate}"
                                                                              width="120" height="180"/>
                                                    </div>
                                                </div>
                                                <span>税务登记证</span>
                                            </li>
                                            <li>
                                                <div class="upload-item">
                                                    <div class="layui-input-inline">
                                                        <expect-x:webUploader required="false"
                                                                              pickerId="organizingInstitutionBarCode"
                                                                              fileCatalog="${sessionScope.merchantNo}"
                                                                              isLocal="false"
                                                                              fileList="${merchantOauth.organizingInstitutionBarCode}"
                                                                              width="120" height="180"/>
                                                    </div>
                                                </div>
                                                <span>组织机构代码</span>
                                            </li>

                                        </ul>
                                    </div>
                                </div>
                            </div>
                            <div class="layui-tab-item">
                                <div class="tableBlock">
                                    <blockquote class="layui-elem-quote">法人信息</blockquote>
                                    <table>
                                        <tbody>
                                        <tr>
                                            <th><span class="require-field">*</span>法人姓名：</th>
                                            <td>
                                                <input type="text" name="legalPersonName" value="${merchantOauth.legalPersonName}" lay-verify="required"
                                                       placeholder="法人姓名" autocomplete="off" class="layui-input">
                                            </td>
                                            <th><span class="require-field">*</span>法人手机号：</th>
                                            <td>
                                                <input type="text" name="legalPersonPhone" value="${merchantOauth.legalPersonPhone}" lay-verify="required|phone"
                                                       placeholder="法人手机号" autocomplete="off" class="layui-input">
                                            </td>
                                        </tr>
                                        <tr>
                                            <th><span class="require-field">*</span>法人身份证：</th>
                                            <td>
                                                <input type="text" name="legalPersonIdentityCard" lay-verify="required|identity"
                                                       value="${merchantOauth.legalPersonIdentityCard}" placeholder="法人身份证"
                                                       autocomplete="off" class="layui-input">
                                            </td>
                                            <th><span class="require-field">*</span>法人身份证有效期：</th>
                                            <td colspan="3">
                                                <c:if test="${fn:length(fn:split(merchantOauth.legalPersonValidityOfIdentityCard,'|' ))==2}">
                                                    <input type="text" id="legal_person_ID_validity" lay-verify="required"
                                                           name="legalPersonValidityOfIdentityCard"
                                                           value="${fn:split(merchantOauth.legalPersonValidityOfIdentityCard,'|' )[0]}"
                                                           placeholder="法人身份证有效期" autocomplete="off" class="layui-input"
                                                           style="width: 50%;float: left">
                                                    <input type="checkbox" title="永久有效" name="box2"
                                                           id="legalPersonValidityOfIdentityCard"
                                                           lay-filter="legalPersonValidityOfIdentityCard" checked
                                                           lay-skin="primary" style="width: 50%;float: left">
                                                </c:if>
                                                <c:if test="${fn:length(fn:split(merchantOauth.legalPersonValidityOfIdentityCard,'|' ))==1}">
                                                    <input type="text" id="legal_person_ID_validity" lay-verify="required"
                                                           name="legalPersonValidityOfIdentityCard"
                                                           value="${merchantOauth.legalPersonValidityOfIdentityCard}"
                                                           placeholder="法人身份证有效期" autocomplete="off" class="layui-input"
                                                           style="width: 50%;float: left">
                                                    <input type="checkbox" title="永久有效" name="box2"
                                                           id="legalPersonValidityOfIdentityCard"
                                                           lay-filter="legalPersonValidityOfIdentityCard"
                                                           lay-skin="primary" style="width: 50%;float: left">
                                                </c:if>






                                            </td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                                <div class="tableBlock">
                                    <blockquote class="layui-elem-quote">法人证件信息</blockquote>
                                    <div class="upload-wrapper upload-div "  >
                                        <ul>
                                            <li>
                                                <div class="upload-item">
                                                    <div class="layui-input-inline">
                                                        <expect-x:webUploader required="true"
                                                                              pickerId="legalPersonIdentificationPortrait"
                                                                              fileCatalog="${sessionScope.merchantNo}"
                                                                              isLocal="false"
                                                                              fileList="${merchantOauth.legalPersonIdentificationPortrait}"
                                                                              width="120" height="180"/>
                                                    </div>
                                                </div>
                                                <span><span class="require-field">*</span>法人身份证照<br>（人像面）</span>
                                            </li>
                                            <li>
                                                <div class="upload-item">
                                                    <div class="layui-input-inline">
                                                        <expect-x:webUploader required="true"
                                                                              pickerId="legalPersonIdCardNationalEmblem"
                                                                              fileCatalog="${sessionScope.merchantNo}"
                                                                              isLocal="false"
                                                                              fileList="${merchantOauth.legalPersonIdCardNationalEmblem}"
                                                                              width="120" height="180"/>
                                                    </div>
                                                </div>
                                                <span><span class="require-field">*</span>法人身份证照<br>（国徽面）</span>
                                            </li>
                                            <li>
                                                <div class="upload-item">
                                                    <div class="layui-input-inline">
                                                        <expect-x:webUploader required="true" pickerId="legalPersonHoldingIdCard"
                                                                              fileCatalog="${sessionScope.merchantNo}"
                                                                              isLocal="false"
                                                                              fileList="${merchantOauth.legalPersonHoldingIdCard}"
                                                                              width="120" height="180"/>
                                                    </div>
                                                </div>
                                                <span><span class="require-field">*</span>法人手持身份证照</span>
                                            </li>

                                        </ul>
                                    </div>
                                </div>
                            </div>
                            <div class="layui-tab-item">
                                <div class="tableBlock">
                                    <blockquote class="layui-elem-quote">企业结算信息</blockquote>
                                    <table class="table table-bordered">
                                        <tbody>
                                        <tr>
                                            <th><span class="require-field">*</span>结算账户户名：</th>
                                            <td>
                                                <input type="text" name="settlementAccountName" lay-verify="required"
                                                       value="${merchantOauth.settlementAccountName}" placeholder="结算账户户名"
                                                       autocomplete="off" class="layui-input">
                                            </td>
                                            <th><span class="require-field">*</span>结算银行卡号：</th>
                                            <td>
                                                <input type="text" name="settlementAccountBankCard" lay-verify="required"
                                                       value="${merchantOauth.settlementAccountBankCard}" placeholder="结算银行卡号"
                                                       autocomplete="off" class="layui-input">
                                            </td>
                                            <th><span class="require-field">*</span>银行预留手机号：</th>
                                            <td>
                                                <input type="text" name="theBankReservesThePhoneNumber" lay-verify="required"
                                                       value="${merchantOauth.theBankReservesThePhoneNumber}" placeholder="银行预留手机号"
                                                       autocomplete="off" class="layui-input">
                                            </td>

                                        </tr>
                                        <tr>
                                            <th><span class="require-field">*</span>开户银行：</th>
                                            <td>
                                                <input type="text" name="depositBank" value="${merchantOauth.depositBank}" lay-verify="required"
                                                       placeholder="开户银行" autocomplete="off" class="layui-input">
                                            </td>
                                            <th><span class="require-field">*</span>开户支行：</th>
                                            <td>
                                                <input type="text" name="accountOpeningBranch" lay-verify="required"
                                                       value="${merchantOauth.accountOpeningBranch}" placeholder="开户支行"
                                                       autocomplete="off" class="layui-input">
                                            </td>
                                            <th><span class="require-field">*</span>开户银行全称(含支行)：</th>
                                            <td>
                                                <input type="text" name="bankName" value="${merchantOauth.bankName}" lay-verify="required"
                                                       placeholder="开户银行全称(含支行)" autocomplete="off" class="layui-input">
                                            </td>

                                        </tr>

                                        <tr>
                                            <th>结算账户联行号：</th>
                                            <td>
                                                <input type="text" name="settlementAccountJonesLangLasalle"
                                                       value="${merchantOauth.settlementAccountJonesLangLasalle}"
                                                       placeholder="结算账户联行号" autocomplete="off" class="layui-input">
                                            </td>

                                            <th><span class="require-field">*</span>结算账户类型：</th>
                                            <td>

                                                <select name="settlementAccountType">
                                                    <option value="法人对私">法人对私</option>
                                                </select>
                                            </td>
                                            <th><span class="require-field">*</span>开户行省市编码：</th>
                                            <td>
                                                <input type="text" name="bankAddressCode" value="${merchantOauth.bankAddressCode}" lay-verify="required"
                                                       placeholder="开户行省市编码" autocomplete="off" class="layui-input">
                                            </td>
                                        </tr>


                                        <tr>

                                            <th><span class="require-field">*</span>银行地址：</th>
                                            <td colspan="2">
                                                <input type="text" name="address" value="${merchantOauth.address}" placeholder="银行地址" lay-verify="required"
                                                       autocomplete="off" class="layui-input">
                                            </td>
                                            <th>备注：</th>
                                            <td colspan="2">
                                                <input type="text" name="remark" value="${merchantOauth.remark}" placeholder="备注"
                                                       autocomplete="off" class="layui-input">
                                            </td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>

                                <div class="tableBlock">
                                    <blockquote class="layui-elem-quote">结算证件信息</blockquote>
                                    <div class="upload-wrapper upload-div ">
                                        <ul>
                                            <li>
                                                <div class="upload-item">
                                                    <div class="layui-input-inline">
                                                        <expect-x:webUploader required="true" pickerId="settlementCardPhotoFront"
                                                                              fileCatalog="${sessionScope.merchantNo}"
                                                                              isLocal="false"
                                                                              fileList="${merchantOauth.settlementCardPhotoFront}"
                                                                              width="120" height="180"/>
                                                    </div>
                                                </div>
                                                <span><span class="require-field">*</span>结算银行卡照片<br>（正面）</span>
                                            </li>
                                            <li>
                                                <div class="upload-item">
                                                    <div class="layui-input-inline">
                                                        <expect-x:webUploader required="true"
                                                                              pickerId="settlementCardPhotoReverseSide"
                                                                              fileCatalog="${sessionScope.merchantNo}"
                                                                              isLocal="false"
                                                                              fileList="${merchantOauth.settlementCardPhotoReverseSide}"
                                                                              width="120" height="180"/>
                                                    </div>
                                                </div>
                                                <span><span class="require-field">*</span>结算银行卡照片<br>（反面）</span>
                                            </li>
                                            <li>
                                                <div class="upload-item">
                                                    <div class="layui-input-inline">
                                                        <expect-x:webUploader required="true" pickerId="settlementPersonIdPortrait"
                                                                              fileCatalog="${sessionScope.merchantNo}"
                                                                              isLocal="false"
                                                                              fileList="${merchantOauth.settlementPersonIdPortrait}"
                                                                              width="120" height="180"/>
                                                    </div>
                                                </div>
                                                <span><span class="require-field">*</span>结算人身份证照<br>（人像面）</span>
                                            </li>
                                            <li>
                                                <div class="upload-item">
                                                    <div class="layui-input-inline">
                                                        <expect-x:webUploader required="true"
                                                                              pickerId="settlementOfTheIdentityCardNationalEmblem"
                                                                              fileCatalog="${sessionScope.merchantNo}"
                                                                              isLocal="false"
                                                                              fileList="${merchantOauth.settlementOfTheIdentityCardNationalEmblem}"
                                                                              width="120" height="180"/>
                                                    </div>
                                                </div>
                                                <span><span class="require-field">*</span>结算人身份证照<br>（国徽面）</span>
                                            </li>
                                            <li>
                                                <div class="upload-item">
                                                    <div class="layui-input-inline">
                                                        <expect-x:webUploader required="false" pickerId="bankOpeningPermit"
                                                                              fileCatalog="${sessionScope.merchantNo}"
                                                                              isLocal="false"
                                                                              fileList="${merchantOauth.bankOpeningPermit}"
                                                                              width="120" height="180"/>
                                                    </div>
                                                </div>
                                                <span>开户行许可证</span>
                                            </li>
                                        </ul>
                                    </div>
                                </div>

                            </div>
                            <div class="layui-tab-item">
                                <div class="tableBlock">
                                    <blockquote class="layui-elem-quote">负责人信息</blockquote>
                                    <table>
                                        <tbody>
                                        <tr>
                                            <th><span class="require-field">*</span>负责人名称：</th>
                                            <td>
                                                <input type="text" name="principalName" value="${merchantOauth.principalName}" lay-verify="required"
                                                       placeholder="负责人名称" autocomplete="off" class="layui-input">
                                            </td>

                                            <th><span class="require-field">*</span>负责人手机号：</th>
                                            <td>
                                                <input type="text" name="principalPhone" value="${merchantOauth.principalPhone}" lay-verify="required|phone"
                                                       placeholder="负责人手机号" autocomplete="off" class="layui-input">
                                            </td>
                                        </tr>
                                        <tr>
                                            <th><span class="require-field">*</span>负责人邮箱：</th>
                                            <td>
                                                <input type="text" name="principalEmail" value="${merchantOauth.principalEmail}" lay-verify="required|email"
                                                       placeholder="负责人邮箱" autocomplete="off" class="layui-input">
                                            </td>
                                            <th><span class="require-field">*</span>负责人联系地址：</th>
                                            <td>
                                                <input type="text" name="contactAddress" value="${merchantOauth.contactAddress}" lay-verify="required"
                                                       placeholder="负责人联系地址" autocomplete="off" class="layui-input">
                                            </td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>

                            <div class="layui-tab-item">
                                <div class="tableBlock">
                                    <blockquote class="layui-elem-quote">门店信息</blockquote>
                                    <table>
                                        <tbody>

                                        <tr>
                                            <th><span class="require-field">*</span>门店名称：</th>
                                            <td>
                                                <input type="text" name="storeName" value="${merchantOauth.storeName}" lay-verify="required"
                                                       placeholder="门店名称" autocomplete="off" class="layui-input">
                                            </td>
                                            <th><span class="require-field">*</span>商家简称：</th>
                                            <td>
                                                <input type="text" name="merchantShortname"
                                                       value="${merchantOauth.merchantShortname}" placeholder="商家简称" lay-verify="required"
                                                       autocomplete="off" class="layui-input">
                                            </td>
                                            <th><span class="require-field">*</span>公司网站：</th>
                                            <td>
                                                <input type="url" name="companyWebsiteAddress"
                                                       value="${merchantOauth.companyWebsiteAddress}" lay-verify="required|url"    placeholder="公司网站"
                                                       autocomplete="off" class="layui-input">
                                            </td>

                                        </tr>
                                        <tr>



                                            <th><span class="require-field">*</span>公司地址：</th>
                                            <td>
                                                <input type="text" name="companyAddress" value="${merchantOauth.companyAddress}" lay-verify="required"
                                                       placeholder="公司地址" autocomplete="off" class="layui-input">
                                            </td>
                                            <th>门店经纬度：</th>
                                            <td>
                                                <input type="text" name="storeLongitudeAndLatitude" lay-verify="required"    id="storeLongitudeAndLatitude" value="${merchantOauth.storeLongitude},${merchantOauth.storeLatitude}" style="cursor: pointer" readonly laceholder="点击选择" autocomplete="off" class="layui-input">
                                                <input type="hidden" name="storeLongitude" value="${merchantOauth.storeLongitude}"
                                                       placeholder="门店经度" autocomplete="off" class="layui-input">
                                                <input type="hidden" name="storelatitude" value="${merchantOauth.storeLatitude}"
                                                       placeholder="门店维度" autocomplete="off" class="layui-input">
                                            </td>
                                            <th><span class="require-field">*</span>门店街道名称：</th>
                                            <td>
                                                <input type="text" name="storeStreet" value="${merchantOauth.storeStreet}" lay-verify="required"
                                                       placeholder="门店街道名称" autocomplete="off" class="layui-input">
                                            </td>
                                        </tr>
                                        <tr>
                                            <th><span class="require-field">*</span>门店省市编码：</th>
                                            <td>
                                                <input type="text" name="storeAddressCode" value="${merchantOauth.storeAddressCode}" lay-verify="required"
                                                       placeholder="门店省市编码" autocomplete="off" class="layui-input">
                                            </td>
                                            <th><span class="require-field">*</span>偏重业务：</th>
                                            <td>
                                                <input type="text" name="primaryService" value="${merchantOauth.primaryService}" lay-verify="required"
                                                       placeholder="偏重业务" autocomplete="off" class="layui-input">
                                            </td>
                                            <th><span class="require-field">*</span>客服电话：</th>
                                            <td>
                                                <input type="text" name="serviceTel" value="${merchantOauth.serviceTel}" lay-verify="required"
                                                       placeholder="客服电话" autocomplete="off" class="layui-input">
                                            </td>

                                        </tr>
                                        <tr>
                                            <th><span class="require-field">*</span>售卖商品/提供服务描述：</th>
                                            <td >
                                                <select name="productDesc">
                                                    <option value="餐饮" ${merchantOauth.productDesc=='餐饮'?'selected':''}>餐饮</option>
                                                    <option value="线下零售" ${merchantOauth.productDesc=='线下零售'?'selected':''}> 线下零售 </option>
                                                    <option value="居民生活服务" ${merchantOauth.productDesc=='居民生活服务'?'selected':''}>居民生活服务  </option>
                                                    <option value="休闲娱乐" ${merchantOauth.productDesc=='休闲娱乐'?'selected':''}>休闲娱乐 </option>
                                                    <option value="交通出行" ${merchantOauth.productDesc=='交通出行'?'selected':''}> 交通出行 </option>
                                                    <option value="其他" ${merchantOauth.productDesc=='其他'?'selected':''}> 其他 </option>
                                                </select>
                                            </td>
                                            <th><span class="require-field">*</span>经营范围：</th>
                                            <td colspan="3">
                                                <input type="text" name="businessScope" value="${merchantOauth.businessScope}" lay-verify="required"
                                                       placeholder="经营范围" autocomplete="off" class="layui-input">
                                            </td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                                <div class="tableBlock">
                                    <blockquote class="layui-elem-quote">门店证件信息</blockquote>
                                    <div class="upload-wrapper upload-div " id="layer-photos">
                                        <ul>
                                            <li>
                                                <div class="upload-item">
                                                    <div class="layui-input-inline">
                                                        <expect-x:webUploader required="true" pickerId="merchantsDoorHead"
                                                                              fileCatalog="${sessionScope.merchantNo}"
                                                                              isLocal="false"
                                                                              fileList="${merchantOauth.merchantsDoorHead}"
                                                                              width="120" height="180"/>
                                                    </div>
                                                </div>
                                                <span><span class="require-field">*</span>商户门头图片</span>
                                            </li>
                                            <li>
                                                <div class="upload-item">
                                                    <div class="layui-input-inline">
                                                        <expect-x:webUploader required="true" pickerId="indoorPic"
                                                                              fileCatalog="${sessionScope.merchantNo}"
                                                                              isLocal="false" fileList="${merchantOauth.indoorPic}"
                                                                              width="120" height="180"/>
                                                    </div>
                                                </div>
                                                <span><span class="require-field">*</span>商家店内环境照</span>
                                            </li>
                                            <li>
                                                <div class="upload-item">
                                                    <div class="layui-input-inline">
                                                        <expect-x:webUploader required="false" pickerId="addressCertification"
                                                                              fileCatalog="${sessionScope.merchantNo}"
                                                                              isLocal="false"
                                                                              fileList="${merchantOauth.addressCertification}"
                                                                              width="120" height="180"/>
                                                    </div>
                                                </div>
                                                <span>经营场地证明</span>
                                            </li>
                                        </ul>
                                    </div>
                                </div>
                            </div>

                            <div class="layui-tab-item">
                                <div class="tableBlock">
                                    <blockquote class="layui-elem-quote">补充证件信息</blockquote>
                                    <div class="upload-wrapper upload-div ">
                                        <ul>

                                            <li>
                                                <div class="upload-item">
                                                    <div class="layui-input-inline">
                                                        <expect-x:webUploader required="false" pickerId="businessAdditionDesc"
                                                                              fileCatalog="${sessionScope.merchantNo}"
                                                                              isLocal="false"
                                                                              fileList="${merchantOauth.businessAdditionDesc}"
                                                                              width="120" height="180"/>
                                                    </div>
                                                </div>
                                                <span>补充说明</span>
                                            </li>
                                            <li>
                                                <div class="upload-item">
                                                    <div class="layui-input-inline">
                                                        <expect-x:webUploader required="false" pickerId="businessAdditionPics"
                                                                              fileCatalog="${sessionScope.merchantNo}"
                                                                              isLocal="false"
                                                                              fileList="${merchantOauth.businessAdditionPics}"
                                                                              width="120" height="180"/>
                                                    </div>
                                                </div>
                                                <span>补充材料</span>
                                            </li>
                                            <li>
                                                <div class="upload-item">
                                                    <div class="layui-input-inline">
                                                        <expect-x:webUploader required="false" pickerId="qualifications"
                                                                              fileCatalog="${sessionScope.merchantNo}"
                                                                              isLocal="false"
                                                                              fileList="${merchantOauth.qualifications}" width="120"
                                                                              height="180"/>
                                                    </div>
                                                </div>
                                                <span>特殊资质</span>
                                            </li>
                                            <li>
                                                <div class="upload-item">
                                                    <div class="layui-input-inline">
                                                        <expect-x:webUploader required="false" pickerId="businessScene"
                                                                              fileCatalog="${sessionScope.merchantNo}"
                                                                              isLocal="false"
                                                                              fileList="${merchantOauth.businessScene}" width="120"
                                                                              height="180"/>
                                                    </div>
                                                </div>
                                                <span>经营场景</span>
                                            </li>

                                        </ul>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>









                </form>
                <script>
                    var businessCode = $('#businessCode').val();
                    if (businessCode == '') {
                        $.ajax({
                            url: "<%=basePath%>manager/merchant/code.html",
                            type: "get",
                            success: function (data) {
                                $('#businessCode').val(data)
                            }
                        });
                    }

                    //Demo
                    layui.use('form', function () {
                        var form = layui.form;

                        form.on('submit(update)', function (data) {
                            if (data.field.box1 != null) {
                                data.field.validityOfBusinessLicense = data.field.validityOfBusinessLicense+"|0";
                            }
                            if (data.field.box2 != null) {
                                data.field.legalPersonValidityOfIdentityCard =  data.field.legalPersonValidityOfIdentityCard+"|0";
                            }
                            if (data.field.box3 != null) {
                                data.field.organizationTime = data.field.organizationTime+"|0";
                            }
                            $.ajax({
                                url: "<%=basePath%>manager/merchant/update.html",
                                type: "POST",
                                data: data.field,
                                dataType: "JSON",
                                success: function (data) {
                                    if (data.success) {
                                        layer.msg("保存成功");
                                        return false;
                                    }
                                }
                            });
                        })


                        //监听提交


                        form.on('submit(formDemo)', function (data) {
                            if (data.field.box1 != null) {
                                data.field.validityOfBusinessLicense = data.field.validityOfBusinessLicense+"|0";
                            }
                            if (data.field.box2 != null) {
                                data.field.legalPersonValidityOfIdentityCard =  data.field.legalPersonValidityOfIdentityCard+"|0";
                            }
                            if (data.field.box3 != null) {
                                data.field.organizationTime = data.field.organizationTime+"|0";
                            }
                            console.log(data.field)
                            layer.msg('资料提交中...', {
                                icon: 16
                                ,shade: 0.01
                            });
                            $.ajax({
                                url: "<%=basePath%>manager/merchant/create.html",
                                type: "POST",
                                data: data.field,
                                async: false,//取消异步请求
                                dataType: "JSON",
                                success: function (data) {
                                    layer.closeAll('loading');
                                    if (data.success) {
                                        layer.msg("更新成功");
                                        setTimeout(function () {
                                            window.location.reload();
                                        }, 1000);
                                    } else {
                                        layer.msg(data.message, {icon: 5});
                                    }
                                }
                            });
                            return false;
                        });
                    });
                </script>
            </c:if>
        </div>
    </div>
</div>

<%@include file="../../../resources/inc/footer.jsp" %>
<script>
    layui.config({
        base: '<%=basePath%>resources/lib/layuiAdmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'table', 'laydate'], function () {
        var $ = layui.$
            , form = layui.form
            , table = layui.table;
        var laydate = layui.laydate;
        laydate.render({
            elem: '#business_license_validity' //指定元素
            ,range: true
            ,done: function(value, date){
            }

        });
        form.on('checkbox(validityOfBusinessLicense)', function (data) {
            var business_license_validity=$('#business_license_validity').val();

            console.log(business_license_validity.split(' - '))
            if (data.elem.checked) {
                if (business_license_validity.length==0){
                   // layer.msg('请选择时间范围');
                }
               // $('#business_license_validity').attr('disabled', 'disabled')
                // $('#business_license_validity').val('')

            } else {
                //$('#business_license_validity').attr('disabled', false)

            }
        });
        form.on('checkbox(legalPersonValidityOfIdentityCard)', function (data) {
            if (data.elem.checked) {
                //$('#legal_person_ID_validity').attr('disabled', 'disabled')
                // $('#legal_person_ID_validity').val('')

            } else {
                //$('#legal_person_ID_validity').attr('disabled', false)
            }
        });
        form.on('checkbox(organizationTimeLicense)', function (data) {
            if (data.elem.checked) {
                //$('#organization_time').attr('disabled', 'disabled')
                // $('#legal_person_ID_validity').val('')

            } else {
               // $('#organization_time').attr('disabled', false)
            }
        });
        laydate.render({
            elem: '#legal_person_ID_validity' //指定元素
            ,range: true
        });
        laydate.render({
            elem: '#organization_time' //指定元素
            ,range: true
        });

    });

</script>
</body>
</html>

